POV-Ray : Newsgroups : povray.general : POV-Ray 3D Sound System : Re: POV-Ray 3D Sound System Server Time
2 Jun 2024 16:15:15 EDT (-0400)
  Re: POV-Ray 3D Sound System  
From: Rune
Date: 17 Sep 2004 13:09:21
Message: <414b1a41$1@news.povray.org>
Tim Nikias wrote:
>> - How can the system be made to work both for clock-based animations
>> and frame-based animations (typically simulations with I/O)?
>
> In my animations, I define a variable Animation_Time, which I use to
> tell different macros how long the scene is in seconds. Especially for
> physics-simulation this is useful, as balls etc drop as much in 10
> frames as in 100 frames. My clock always run from 0 to 1.

This is not what I meant. All time is measured in milliseconds in my system,
so the problem is not a matter of units.

The problem is this: Say you have a ball that hits the ground at some point
in time and when that happens you want a sound to be played. In a
clock-based (deterministic) animation you know all from the beginning at
what time the ball hits the ground so you just specify that time value like
this:

//               name    sound_filename    time
sound_point_loop("ball","wavdata/bump.wav",1000*3.5)

This should play the sound after 3.5 seconds. Now, how should this
information be put into the data text file? My sound system include file is
invoked in every frame of the animation, but naturally it should not save
the information "play bump.wav after 3500 milliseconds" every time it is
invoked (which is in every frame). This would create dublicate information.
In my current system such information is simply saved to the file the first
time the system is invoked, that is, in frame 1. The macro is called in all
frames, but only in the first frame does it do something. No problems so
far.

However, in a simulation based system where the ball could be controlled by
some physics system, you don't know from the beginning at what point in time
the ball will hit the ground. So you can't save it to the data file the
first time the system is invoked. You typically don't know it until the
frame that comes right before or right after the impact (assuming the impact
happens between two frames, which is most likely). Then when you invoke the
macro at this point it's no good if it doesn't do anything (because it only
does something in the first frame).

So - I don't quite know how to implement a good solution that works in both
cases.

>> - How should the specification of the data file be? The current one
>> is somewhat a mess.
>
> Not quiet sure what you mean with the data file. The POV-Source?

You haven't seen it. We can discuss it later once I've gotten a few files up
for download.

> Me neither. But if your app just parses the data-file and outputs a
> wave-file, a simple batch-file which runs the app should be
> sufficient.

Yeah. Only, it still requires that you have both Java Virtual Machine and
OpenAL installed - I think.

> I hope some of my comments are of some help. I'd like to have a look
> and all, but I'm currently tied up working on an IRTC entry that
> needs to be finished, but I'll be happy to participate in a few
> brainstorming sessions or discussions, either here or via email. But
> maybe off-topic would be a better area to discuss things then, in
> order not to junk the groups here.

Thanks for the offer.

I don't think it's off-topic, at least not major parts of the discussion.
And it would be impractical if the things we discuss are lost in a few weeks
time. For now I think we can just keep the discussion here.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.